package com.linktrip.devicemanager.util;

import java.io.IOException;
import sun.misc.BASE64Decoder;

public class Constant {

	public static final int DEFAULT_PORT = 8877;
	public static final int DEFAULT_QUEUE_SIZE = 1024;
	public static final int DEFAULT_TRY_TIME = 25;
	public static final String USER_SESSION = "USER_SESSION_INFO";
	public static final int RESPONSE_OK = 200;
	public static final int RESPONSE_ERR = 500;
	public static final int RESULT_NOT_MATCH = 400;
	public static final int PAGE_SIZE = 20;
	
	public static final String DEFAULT_POST = "POST";
	public static final String DEFAULT_GET = "GET";

	public static final String JDBC_DRIVERCLASSNAME = "jdbc.driverClassName";
	public static final String JDBC_URL = "jdbc.url";
	public static final String JDBC_USERNAME = "jdbc.username";
	public static final String JDBC_PASSWORD = "jdbc.password";
	public static final byte[] DES_KEY_IV = { 1, 2, 3, 4, 5, 6, 7, 8 };
	public static byte[] DES_KEY = getKey();
	private static final String PRIVATE_KEY = "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4";
	
	@SuppressWarnings("restriction")
	private static byte[] getKey() {

		byte[] by = null;
		
		try {
			by = new BASE64Decoder().decodeBuffer(PRIVATE_KEY);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return by;
	}
}
